<?php

namespace App\Http\Resources\CRM\Report;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class MemberMoneyResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @return array<string, mixed>
     */
    public function toArray(Request $request): array
    {
        return [
            'telephone' => $this->member->phone,
            'name' => $this->member->name,
            'reg_store' => $this->member->registerStore->name,
            'operator_store' => $this->user->store->name,
            'money' => $this->money,
            'base_money' => $this->money - $this->give_money,
            'give_money' => $this->give_money,
            'before_money' => $this->before_money,
            'after_money' => $this->after_money,
            'content' => $this->content,
            'created_at' => $this->created_at,
        ];
    }
}
